﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using BAL;

namespace blog.Class
{
    /// <summary>
    /// Httphendel 的摘要说明
    /// </summary>
    public class Httphendel : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string str = context.Request.QueryString["id"].ToString();
            string straction = context.Request.QueryString["action"].ToString();
            if (straction == "delete")
            {
                int i = BAL.DoPost.deletepost(str);
                if (i != -1)
                {
                    context.Response.Write("刪除成功!");
                }
                else
                    context.Response.Write("刪除失敗!");
            }
            else if (straction == "edit")
            {

            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}